module.exports = () => {
    return async (ctx,next) => {
        if(ctx.request.path !== '/bookslist'){
            if(ctx.get('egg-identity') && ctx.get('egg-identity') === 'admin'){
                await next();
            }else{
                ctx.body = {
                    msg:"无权限", status:401
                }
            }
        }else{
            await next();
        }
    }
}
